Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make module Translator usable on Storybook #809

Merged

Conversation

Quetzacoalt91
Copy link
Member

@Quetzacoalt91 Quetzacoalt91 commented Jul 17, 2024

Questions Answers
Description? Allow the translations to be used when using Storybook, allowing the templates to be multi languages while working on them. This PR also removes the use of PrestaShop constants in the Translator class, making it unit-testable and usable outside the BO context.
Type? new feature
BC breaks? Nope
Deprecations? Nope
Fixed ticket? /
Sponsor company @PrestaShopCorp
How to test? Translations are still available on the module in the BO (non-regression tests), and you can now switch on another language from the top bar of Storybook.
Capture.video.du.2024-07-17.11-11-20.webm

@Quetzacoalt91 Quetzacoalt91 self-assigned this Jul 17, 2024
@Quetzacoalt91 Quetzacoalt91 force-pushed the translations-on-storybook branch 2 times, most recently from c8989fc to 2bfaed0 Compare July 17, 2024 10:30
@Quetzacoalt91 Quetzacoalt91 marked this pull request as ready for review July 17, 2024 10:35
@Quetzacoalt91 Quetzacoalt91 changed the title Make Translator usable on Storybook and the module Make module Translator usable on Storybook Jul 17, 2024
ga-devfront
ga-devfront previously approved these changes Jul 17, 2024
Copy link
Contributor

@ga-devfront ga-devfront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All seams good, just one comment to improve code style.

autoupgrade.php Outdated Show resolved Hide resolved
@Quetzacoalt91 Quetzacoalt91 force-pushed the translations-on-storybook branch 2 times, most recently from 7ed0cba to b9d7cc5 Compare July 18, 2024 15:29
@Quetzacoalt91 Quetzacoalt91 force-pushed the translations-on-storybook branch 2 times, most recently from 111e169 to 77d6cb3 Compare July 18, 2024 15:42
M0rgan01
M0rgan01 previously approved these changes Jul 19, 2024
@Quetzacoalt91
Copy link
Member Author

Issue reported from QA after rebase. One variable needs to be set.

image

Copy link
Contributor

@AureRita AureRita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Quetzacoalt91

Thank you for your PR, I tested it and it seems to works as we expected :

Tested from :
1.7.8.8 to 8.1.7
8.0.5 to 8.1.7
8.1.5 to 8.1.7
8.1.7 to 9.0.0
8.1.5 to 9.0.0
8.0.5 to 9.0.0

Because the PR seems to works as expected, It's QA ✔️

Thank you

@Quetzacoalt91 Quetzacoalt91 merged commit 5c190f3 into PrestaShop:dev Aug 6, 2024
34 checks passed
@Quetzacoalt91 Quetzacoalt91 deleted the translations-on-storybook branch August 6, 2024 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

6 participants